package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Ctag entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ctag", catalog = "bms")
public class Ctag implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date fullyExecuted;
	private Date notifiedExternalEc;
	private Date notifiedLocalEc;
	private Date partiallyExecuted;
	private Date sentToExternalEc;
	private Date sentToLocalEc;
	private Date sentToSite;
    private Integer scope;

    public static final String CLASSTITLE = "CTAg";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
        Collections.unmodifiableMap(
            new LinkedHashMap<String, String>() {
                {
                    put("sentToSite", "Sent to Site");
                    put("sentToExternalEc", "Sent to External EC");
                    put("notifiedExternalEc", "Notified External EC");
                    put("sentToLocalEc", "Sent to Local EC");
                    put("notifiedLocalEc", "Notified Local EC");
                    put("partiallyExecuted", "Partially Executed (date)");
                    put("fullyExecuted", "Fully Executed (date)");
                }
            }
        )
    );

	// Constructors

	/** default constructor */
	public Ctag() {
	}

	/** minimal constructor */
	public Ctag(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Ctag(ProtocoloCentro protocoloCentro, Date fullyExecuted,
			Date notifiedExternalEc, Date notifiedLocalEc,
			Date partiallyExecuted, Date sentToExternalEc, Date sentToLocalEc,
			Date sentToSite) {
		this.protocoloCentro = protocoloCentro;
		this.fullyExecuted = fullyExecuted;
		this.notifiedExternalEc = notifiedExternalEc;
		this.notifiedLocalEc = notifiedLocalEc;
		this.partiallyExecuted = partiallyExecuted;
		this.sentToExternalEc = sentToExternalEc;
		this.sentToLocalEc = sentToLocalEc;
		this.sentToSite = sentToSite;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "fullyExecuted", length = 10)
	public Date getFullyExecuted() {
		return this.fullyExecuted;
	}

	public void setFullyExecuted(Date fullyExecuted) {
		this.fullyExecuted = fullyExecuted;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "notifiedCentralEC", length = 10)
	public Date getNotifiedExternalEc() {
		return this.notifiedExternalEc;
	}

	public void setNotifiedExternalEc(Date notifiedExternalEc) {
		this.notifiedExternalEc = notifiedExternalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "notifiedLocalEC", length = 10)
	public Date getNotifiedLocalEc() {
		return this.notifiedLocalEc;
	}

	public void setNotifiedLocalEc(Date notifiedLocalEc) {
		this.notifiedLocalEc = notifiedLocalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "partiallyExecuted", length = 10)
	public Date getPartiallyExecuted() {
		return this.partiallyExecuted;
	}

	public void setPartiallyExecuted(Date partiallyExecuted) {
		this.partiallyExecuted = partiallyExecuted;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToCentralEC", length = 10)
	public Date getSentToExternalEc() {
		return this.sentToExternalEc;
	}

	public void setSentToExternalEc(Date sentToExternalEc) {
		this.sentToExternalEc = sentToExternalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToLocalEC", length = 10)
	public Date getSentToLocalEc() {
		return this.sentToLocalEc;
	}

	public void setSentToLocalEc(Date sentToLocalEc) {
		this.sentToLocalEc = sentToLocalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToSite", length = 10)
	public Date getSentToSite() {
		return this.sentToSite;
	}

	public void setSentToSite(Date sentToSite) {
		this.sentToSite = sentToSite;
	}

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}